graph check if directed graph is strongly connected